Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jkbonfield/htscodecs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jkbonfield/htscodecs

Reference implementation of CRAM 3.1 codecs

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
115
decreased by-57.09%
Maintainers
1
Weekly downloads
 
Created
Source

Reference implementation files

This directory contains javascript implementations of the custom codecs using in CRAM 3.1, capable of being run under node.js.

These is not written for speed, but for clarity and as an exercise in checking the pseudocode in the CRAM specification. It is written as close to this pseudocode as is possible.

Prerequisites: minimist package for command line parsing and bzip2 for part of the arith_gen.js code.

npm install minimist
npm install bzip2

iostream.js

Makes a buffer appear to be a stream with ReadByte, ReadITF8, etc functions.

rans.js

Implements the order-0 and order-1 rans (4x8) decoder as used in CRAM3.0.

main_rans.js

A command line tool to exercise the rans.js code, included for debug purposes.

rans4x16.js, main_rans4x16.js

A 16-bit renormalising variant of rANS above. This also includes transforms for RLE, bit-packing and 4-way interleaving.

arith_sh.js

Arithmetic (range) coding with Schindler carry handling.

byte_model.js

An adaptive model for keeping track of symbol frequencies.

arith_gen.js, main_arith_gen.js

Wrapper around arith_sh.js to perform order-0/1 encoding with RLE and bit-packing. Plus debug command line tool

fqzcomp.js, main_fqzcomp.js

Implements the fqzcomp quality compression codec. Plus debug command line tool.

tok3.js, main_tok3.js

Implements the tokenise_name3 read identifier compression codec. Plus debug command line tool.

Testing

The various main js files can be used for adhoc testing. There is also a Makefile which performs checks against known defined data streams and does round-trip testing in both Javascript and if compiled the C variant. You can set CORPUS make variable to a larger data set such htscodecs-corpus.

eg.

make check CORPUS=../tests/htscodecs-corpus/

Keywords

FAQs

Package last updated on 30 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc